{template 'common/header'}
{template 'web/task/navs'}
<style>
    .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {overflow: visible !important;}
    .dropdown-menu{min-width:4em;}
    .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {white-space: normal !important;overflow: visible !important;}
    .dropdown{display:inline-block !important;}
    .account-stat-num > div {width: 25%;float: left;font-size: 16px;text-align: center;}
    .account-stat-num > div span {display: block;font-size: 30px;font-weight: bold;}
</style>
<div class="panel panel-default">
    <div class="panel-heading">
        任务列表
    </div>
    <div class="panel-body">
        <table st-table="items" class="table table-striped table-condensed" style="display:auto;">
            <thead>
            <tr>
                <th style="width:6em;">头像</th>
                <th style="width:12em;">昵称</th>
                <th style="width:6em;">总金额</th>
                <th style="width:5em;">装态</th>
                <th style="width:22em;">详情</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {loop $list['list'] $li}
            <tr>
                {php $member = M('member')->getInfo($li['openid'])}
                <td>
                    <img src="{php echo tomedia($member['avatar'])}" style="width:4em;height:4em;" class="img-rounded"/>
                </td>
                <td>
                    <label class="label label-info">{$member['nickname']}</label>
                </td>
                <td>
                    <label class="label label-info">{$li['total']}</label>
                </td>
                <td>
                    <label class="label label-danger">
                        {if $li['status']==1}
                        等待接单
                        {else if $li['status'] == 0}
                        未支付
                        {else if $li['status'] == 2}
                        已接单
                        {else if $li['status'] == 3}
                        待结款
                        {else if $li['status'] == 4}
                        已结款
                        {/if}
                    </label>
                </td>
                <td>
                    {php $field_datas = M('category_field_data')->getall(array('task_id'=>$li['id']))}
                    {loop $field_datas $data}
                        {php $field = M('category_field')->getInfo($data['field_id'])}
                        {if $field['type'] == 'image'}
                            {php $images = unserialize($data['value'])}
                            {loop $images $image}
                            <img src="{php echo tomedia($image)}" style="width:2em;height:2em;" alt=""/>
                            {/loop}
                            <br/>
                        {else if $field['type'] == 'address'}
                            {php $value = unserialize($data['value'])}
                            <label class="label label-info">{$field['title']}:{$value['poiaddress']}</label>
                            <br/>
                        {else}
                            <label class="label label-info">{$field['title']}:{$data['value']}</label>
                            <br/>
                        {/if}
                    {/loop}
                </td>
                <td>
                    <a href="{php echo $this->createWebUrl('category_task',array('act'=>'delete','category_id'=>$category_id,'id'=>$li['id']))}" class="btn btn-danger">删除</a>
                </td>
            </tr>
            {/loop}
            </tbody>
        </table>
        {php echo $list['pager']}
    </div>
</div>
{template 'common/footer'}